﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MaintainPaperQuestions.aspx.cs"
    Inherits="OA.Exam.MaintainPaperQuestions" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>设置试卷小题</title>
    <link href="../Themes/Default/Style.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" language="javascript">
        function checkAllLeft() {
            var Myform = document.getElementsByTagName("input");
            
                if (document.all.chballleft.checked) {
                    for (var i = 0; i < Myform.length; i++) {
                        if (Myform[i].id.indexOf("GridViewQuestionsLeft") != -1) {
                            Myform[i].checked = true;
                        }
                    }
                }
                else {

                    for (var i = 0; i < Myform.length; i++) {
                        if (Myform[i].id.indexOf("GridViewQuestionsLeft") != -1) {
                            Myform[i].checked = false;
                        }
                    }
                }
            }

            function checkAllRight() {
                var Myform = document.getElementsByTagName("input");

                if (document.all.chballright.checked) {
                    for (var i = 0; i < Myform.length; i++) {
                        if (Myform[i].id.indexOf("GridViewQuestionsRight") != -1) {
                            Myform[i].checked = true;
                        }
                    }
                }
                else {

                    for (var i = 0; i < Myform.length; i++) {
                        if (Myform[i].id.indexOf("GridViewQuestionsRight") != -1) {
                            Myform[i].checked = false;
                        }
                    }
                }
            }
    </script>
    
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table width="98%">
            <tr>
                <td colspan="3" class="TitleZone">
                    维护试卷<asp:Label ID="LabItemType" runat="server" Text=""></asp:Label>
                    <input id="HiddenPaperId" type="hidden" runat="server" />
                    <input id="HiddenTypeId" type="hidden" runat="server" />
                </td>
            </tr>
            <tr>
                <td colspan="3" align="center">
                    <asp:Label ID="LabPrompt" runat="server" Text="" ForeColor="Red"></asp:Label>
                </td>
            </tr>
            <tr>
                <td style="width: 45%">
                    </td>
                <td style="width: 10%">
                    </td>
                <td style="width: 45%; text-align:right;">
                    <asp:Button ID="BtnBack" runat="server" Text="返回" CssClass="closebtn" 
                        onclick="BtnBack_Click" />
                </td>
            </tr>
            <tr style="background-color:#e2c0a4; text-align:center;">
                <td style="width: 45%">
                    可选题目</td>
                <td style="width: 10%">
                    移动</td>
                <td style="width: 45%">
                    已选题目</td>
            </tr>
            <tr>
                <td style="width: 45%" valign="top">
                    <table width="98%">
                        <tr>
                            <td>
                                &nbsp;&nbsp;所属分组：
                                <asp:DropDownList ID="DdlGroupLeft" runat="server" CssClass="" AppendDataBoundItems="true"
                                    DataTextField="GroupName" DataValueField="GroupId">
                                    <asp:ListItem Value="-1">-请选择-</asp:ListItem>
                                </asp:DropDownList>
                                &nbsp;&nbsp;题目：
                                <asp:TextBox ID="TxtSubjectLeft" runat="server" CssClass="inputText"></asp:TextBox>
                                &nbsp;&nbsp;<asp:Button ID="BtnSearchLeft" runat="server" Text="查询" 
                                    CssClass="closebtn" onclick="BtnSearchLeft_Click" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:GridView ID="GridViewQuestionsLeft" runat="server" AutoGenerateColumns="false" CssClass="GridViewStyle"
                                    Width="100%" AllowPaging="true" EmptyDataText="暂无题目" DataKeyNames="QuestionId">
                                    <Columns>
                                        <asp:TemplateField>
                                            <HeaderTemplate>
                                                <input id="chballleft" type="checkbox" onclick="checkAllLeft()" />
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="ChbCheck" runat="server" />
                                            </ItemTemplate>
                                            <HeaderStyle Width="4%" HorizontalAlign="Left" />
                                            <ItemStyle Width="4%" />
                                        </asp:TemplateField>
                                        
                                        <asp:BoundField DataField="Subject" HeaderText="题目" ItemStyle-Width="50%">
                                            <ItemStyle Width="50%"></ItemStyle>
                                        </asp:BoundField>
                                        
                                    </Columns>
                                    <FooterStyle CssClass="GridViewFooterStyle" />
                                    <RowStyle CssClass="GridViewRowStyle" />
                                    <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
                                    <PagerStyle CssClass="GridViewPagerStyle" />
                                    <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                    <HeaderStyle CssClass="GridViewHeaderStyle" />
                                </asp:GridView>
                            </td>
                        </tr>
                    </table>
                </td>
                <td style="width: 10%; text-align:center;">
                    <asp:Button ID="BtnAdd" runat="server" Text=">>" CssClass="closebtn" 
                        onclick="BtnAdd_Click"/><br />
                    <asp:Button ID="BtnRemove" runat="server" Text="<<" CssClass="closebtn" 
                        onclick="BtnRemove_Click" />

                </td>
                <td style="width: 45%" valign="top">
                    <table width="98%">
                        <tr>
                            <td>
                                &nbsp;&nbsp;所属分组：
                                <asp:DropDownList ID="DdlGroupRight" runat="server" CssClass="" AppendDataBoundItems="true"
                                    DataTextField="GroupName" DataValueField="GroupId">
                                    <asp:ListItem Value="-1">-请选择-</asp:ListItem>
                                </asp:DropDownList>
                                &nbsp;&nbsp;题目：
                                <asp:TextBox ID="TxtSubjectRight" runat="server" CssClass="inputText"></asp:TextBox>
                                &nbsp;&nbsp;<asp:Button ID="BtnSearchRight" runat="server" Text="查询" 
                                    CssClass="closebtn" onclick="BtnSearchRight_Click" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <asp:GridView ID="GridViewQuestionsRight" runat="server" AutoGenerateColumns="false" CssClass="GridViewStyle"
                                    Width="100%" AllowPaging="true" EmptyDataText="暂未选择题目" DataKeyNames="QuestionId">
                                    <Columns>
                                        <asp:TemplateField>
                                            <HeaderTemplate>
                                                <input id="chballright" type="checkbox" onclick="checkAllRight()" />
                                            </HeaderTemplate>
                                            <ItemTemplate>
                                                <asp:CheckBox ID="ChbCheck" runat="server" />
                                            </ItemTemplate>
                                            <HeaderStyle Width="4%" HorizontalAlign="Left" />
                                            <ItemStyle Width="4%" />
                                        </asp:TemplateField>
                                        
                                        <asp:BoundField DataField="Subject" HeaderText="题目" ItemStyle-Width="50%">
                                            <ItemStyle Width="50%"></ItemStyle>
                                        </asp:BoundField>
                                        
                                    </Columns>
                                    <FooterStyle CssClass="GridViewFooterStyle" />
                                    <RowStyle CssClass="GridViewRowStyle" />
                                    <SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
                                    <PagerStyle CssClass="GridViewPagerStyle" />
                                    <AlternatingRowStyle CssClass="GridViewAlternatingRowStyle" />
                                    <HeaderStyle CssClass="GridViewHeaderStyle" />
                                </asp:GridView>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td colspan="3">
                    
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
